package com.xiaocheng.core.visitor.impl;

import java.awt.print.Book;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import com.xiaocheng.core.visitor.BookInterface;
import com.xiaocheng.core.visitor.VisitorInterface;

public class Libary {
	List<BookInterface> Books = new ArrayList<>();
	
	public void add(BookInterface bookInterface){
		Books.add(bookInterface);
	}
	
	public void show(VisitorInterface visitor){
		Iterator<BookInterface> iterator = Books.iterator();
		while(iterator.hasNext()){
			BookInterface bookInterface = iterator.next();
			bookInterface.accept(visitor);
		}
	}

}
